package com.pms.web;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.pms.entity.Idea;
import com.pms.entity.IdeaComment;
import com.pms.service.IdeaCommentService;

public class IdeaCommentServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpSession session=request.getSession();
		Idea idea=(Idea)session.getAttribute("idea");
		String ideaId=idea.getIdeaId();
		IdeaCommentService ics=new IdeaCommentService();
		List<IdeaComment> ideaCommentList=(List<IdeaComment>)ics.findByIdeaId(ideaId);
		session.setAttribute("ideacommentlist", ideaCommentList);
		request.getRequestDispatcher("/WEB-INF/views/idea_show.jsp").forward(request, response);
	}
}
